﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;

namespace Cheems.Control.Styles
{
    public partial class DefaultWindowStyle : ResourceDictionary
    {
        public DefaultWindowStyle()
        {
            InitializeComponent();
        }

        private void MinimizeWindow(object sender, RoutedEventArgs e)
        {
            var window = Window.GetWindow(sender as DependencyObject);
            if (window != null)
            {
                window.WindowState = WindowState.Minimized;
            }
        }

        private void MaximizeWindow(object sender, RoutedEventArgs e)
        {
            var window = Window.GetWindow(sender as DependencyObject);
            if (window != null)
            {
                window.WindowState = WindowState.Maximized;
            }
        }

        private void RestoreWindow(object sender, RoutedEventArgs e)
        {
            var window = Window.GetWindow(sender as DependencyObject);
            if (window != null)
            {
                window.WindowState = WindowState.Normal;
            }
        }

        private void CloseWindow(object sender, RoutedEventArgs e)
        {
            var window = Window.GetWindow(sender as DependencyObject);
            window?.Close();
        }

        private void DragMove(object sender, MouseButtonEventArgs e)
        {

            var window = Window.GetWindow(sender as DependencyObject);
            window?.DragMove();
        }

    }
}
